package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.UserDishService;
import com.sky.vo.DishVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/dish/list")
public class UserDishController {

    @Autowired
    private UserDishService userDishService;

    @GetMapping
    public Result list(@RequestParam String categoryId) {
        List<DishVO> result = userDishService.list(categoryId);
        return Result.success(result);
    }
}
